package com.diligreat.action; 

import java.util.List;

import com.diligreat.action.base.BaseAction;
import com.diligreat.domain.Lang;
import com.diligreat.service.LangService;
import com.opensymphony.xwork2.ModelDriven;

/**  
 * @Author Bruce 
 * @Date 2012-11-5
 * @Comments
 */
public class LangAction extends BaseAction implements ModelDriven<Lang> {
	private static final long serialVersionUID = 1L;
	private Lang lang = new Lang();
	private List<Lang> langList;
	private LangService langService;
	//private List<Lang> regionList;
	
	public String input(){
		System.out.println("input()");
		langList = langService.getRegionList();
		return INPUT;
	}
	public String addSubmit(){
		langService.addLang(lang);
		return "goInput";
	}
	public String list(){
		langList = langService.list();
		return SUCCESS;
	}
	/*public String update(){
		langService.updateLang(lang);
		return "goInput";
	}*/
	public String updateSubmit(){
		langService.updateLang(lang);
		return "goInput";
	}
	public String del(){
		langService.deleteLang(lang.getId());
		return "goInput";
	}
	//============= get and set ====================
	
	public void setLangService(LangService langService) {
		this.langService = langService;
	}
	
	@Override
	public Lang getModel() {
		return lang;
	}
	public List<Lang> getLangList() {
		return langList;
	}
	/*public List<Lang> getRegionList() {
		return regionList;
	}*/
	
	
}
 